package com.zwj.controller;


import com.zwj.bo.MenuBo;
import com.zwj.dto.Result;
import com.zwj.entity.NodeDiscussEntity;
import com.zwj.entity.SysUserEntity;
import com.zwj.mapper.SysMenuMapper;
import com.zwj.service.NodeDiscussService;
import com.zwj.service.SysMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  课程答疑控制器
 * </p>
 *
 * @author zxj
 * @since 2021-11-02
 */
@Api(value = "课程评论",tags="课程评论")
@RestController
@RequestMapping("/node-discuss-entity")
public class NodeDiscussController {
    private final NodeDiscussService nodeDiscussService;

    public NodeDiscussController(NodeDiscussService nodeDiscussService) {
        this.nodeDiscussService = nodeDiscussService;
    }

    @ApiOperation(value = "条件查询评论", notes = "条件查询评论")
    @PostMapping("/selectNodeDiscuss")
    public Result selectNodeDiscuss(@RequestBody NodeDiscussEntity nodeDiscussEntity) {
        return nodeDiscussService.selectNodeDiscuss(nodeDiscussEntity);
    }

    @ApiOperation(value = "查询评论", notes = "查询评论")
    @PostMapping("/selectNodeDiscussList")
    public Result selectNodeDiscussList(@RequestBody NodeDiscussEntity nodeDiscussEntity) {
        return nodeDiscussService.selectNodeDiscussList(nodeDiscussEntity);
    }

    @ApiOperation(value = "发表评论", notes = "发表评论")
    @PostMapping("/addNodeDiscuss")
    public Result addNodeDiscuss(@RequestBody NodeDiscussEntity nodeDiscussEntity, HttpServletRequest request) {
        return nodeDiscussService.addNodeDiscuss(nodeDiscussEntity,request);
    }
}

